package com.goudan.rabbitmq.util;

import com.goudan.rabbitmq.manager.EventDispatcher;
import com.goudan.rabbitmq.support.SpringContextHolder;

/**
 * MQ发送消息工具类
 */
public class EventDispatcherUtil {

    private static EventDispatcher eventDispatcher;

    public static void eventDispatch(Object message, Integer delay) {
        if (eventDispatcher == null) {
            eventDispatcher = SpringContextHolder.getBean("eventDispatcher");
        }
        eventDispatcher.eventDispatch(message, delay);

    }
}
